﻿using DDD.Domain.Abstract.DomainEvent;
using DDD.Domain.Entities;
using DDD.IntegrationEvent;

namespace DDD.Domain.DomainEvents.UserDomainEvents
{
    public record CreateUserDomainEvent : IDomainEvent
    {
        public User User { get; init; }

        public CreateUserIntegrationEvent ToCreateUserIntegrationEvent()
        {
            return new CreateUserIntegrationEvent()
            {
                Id = this.User.Id,
                Email = this.User.Email,
                Phone = this.User.Phone,
                UserName = this.User.UserName
            };
        }
    }
}


